<template>
  <NavBarHeader />
  <router-view></router-view>
  <van-tabbar
    v-model="$route.name"
    @change="onChange"
    v-show="!$route.meta.back"
  >
    <van-tabbar-item name="homepage" icon="home-o">首页</van-tabbar-item>
    <van-tabbar-item name="user" icon="friends-o" :badge="$homeOption.users"
      >用户</van-tabbar-item
    >
    <van-tabbar-item name="message" icon="chat-o">消息</van-tabbar-item>
    <van-tabbar-item name="set" icon="setting-o">设置</van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import { ref, watch, getCurrentInstance, onMounted } from "vue";
import NavBarHeader from "../components/nav/NavBarHeader.vue";

const active = ref("homepage");
const { proxy } = getCurrentInstance();

/* 切换tabbar */
function onChange(_new) {
  proxy.$router.push(_new);
}


</script>

<style scoped>
</style>
